[ASAN] set-origin: Squash a leak
authorColin Walters <walters@verbum.org>
Tue, 29 Nov 2016 03:03:24 +0000 (22:03 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 30 Nov 2016 18:51:26 +0000 (18:51 +0000)
Just a minor leak in the commandline.

Closes: #598
Approved by: jlebon

src/ostree/ot-admin-builtin-set-origin.c

index 0e79ab5e53f32cf53423491091f95f95a876439c..2b6866cc5e884a35cc84d4855b017c0228fc00a6 100644 (file)
@@ -50,7 +50,7 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
   const char *branch = NULL;
   glnx_unref_object OstreeRepo *repo = NULL;
   glnx_unref_object OstreeSysroot *sysroot = NULL;
-  OstreeDeployment *target_deployment = NULL;
+  glnx_unref_object OstreeDeployment *target_deployment = NULL;
 
   context = g_option_context_new ("REMOTENAME URL [BRANCH]");
 
@@ -85,6 +85,8 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
                                "Not currently booted into an OSTree system");
           goto out;
         }
+      /* To match the below */
+      target_deployment = g_object_ref (target_deployment);
     }
   else
     {